﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BakalarskaPraca.Generation.Data.Settings;

namespace BakalarskaPraca.Forms.Controls
{
    public partial class PlantGenerationSettingsControl : UserControl
    {
        public PlantGenerationSettingsControl()
        {
            InitializeComponent();
            this.PlantGenerationStyleComboBox.SelectedIndex = (int)Properties.Settings.Default.PlantGenerationStyle;
        }

        private void PlantGenerationStyleComboBoxSelectedIndexChanged(object sender, EventArgs e)
        {
            Properties.Settings.Default.PlantGenerationStyle =
                (Enum.GetValues(typeof (PlantGenerationStyle))
                    .GetValue(this.PlantGenerationStyleComboBox.SelectedIndex) is PlantGenerationStyle ? 
                        (PlantGenerationStyle) Enum.GetValues(typeof (PlantGenerationStyle)).GetValue(this.PlantGenerationStyleComboBox.SelectedIndex) : 
                        PlantGenerationStyle.RealPositionGeneration);
        }
    }
}
